package stuttgart.uni.pedometer;

import java.util.Vector;

//Queue
public class WriteToStorageJobs<T>{
	
	Vector<T> jobs;
	
	public WriteToStorageJobs() {
		jobs = new Vector<T>(0,1);
	}
	
	public synchronized void add(T element){
		jobs.add(element);
		notify();
	}
	
	public synchronized T poll() throws InterruptedException{
		if (jobs.isEmpty()) {
			wait();
		}
		return jobs.remove(0);
	}
	
}
